//
//  HomeSectionHeadView.m
//  LPTClient
//
//  Created by mac on 2018/12/4.
//  Copyright © 2018年 zhaodd. All rights reserved.
//

#import "HomeSectionHeadView.h"

@implementation HomeSectionHeadView

- (instancetype)init
{
    self = [super init];
    if (self) {
        
        [self initSubViews];
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self) {
        [self initSubViews];
        self.backgroundColor = [UIColor whiteColor];
    }
    
    return self;
}

-(void)initSubViews
{
    UIImageView *icon = [[UIImageView alloc] init];
    icon.backgroundColor = [UIColor colorWithHexString:@"#37D842"];
    [self addSubview:icon];
    [icon mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.leading.mas_equalTo(@(12));
        make.centerY.mas_equalTo(self);
        make.size.mas_equalTo(CGSizeMake(2, 10));
    }];
    
    UILabel *title = [[UILabel alloc] init];
    title.font = [UIFont boldSystemFontOfSize:15.0f];
    title.text = @"最新问诊";
    title.textColor = [UIColor colorWithHexString:@"333333"];
    [self addSubview:title];
    [title mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.mas_equalTo(icon.mas_trailing).mas_offset(8);
        make.centerY.mas_equalTo(self);
    }];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
